﻿

const reClick = {
    mounted: (el, binding, vnode, prevNode) => {
        el.addEventListener('click', e => {
            if (!el.disabled) {
                el.disabled = true;
                el.style.cursor = 'not-allowed';
                el.classList.add('is-disabled');
                setTimeout(() => {
                    el.disabled = false;
                    el.style.cursor = 'pointer';
                    el.classList.remove('is-disabled');
                }, binding.value || 1000);
            }
        });
    }
};

export default reClick